from django.urls import path, include
from rest_framework import routers

from api import views
router = routers.SimpleRouter()
router.register(prefix='register', viewset=views.RegisterView, basename='register')
print(router.urls)


urlpatterns = [
    # path('register/', views.RegisterView.as_view(actions={'post': 'create'})),
    path('', include(router.urls)),  # 第2种
]

# urlpatterns += route.urls  # 第一种方式